cmake_minimum_required(VERSION 3.5)
project(my_kitti_lidar_seg)

# 必须设置编译模式为Debug，否则无法源码调试
set(CMAKE_BUILD_TYPE Debug)

# 使用C++17标准（必须！否则std::filesystem无法使用）
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)


find_package(PCL 1.12 REQUIRED)
find_package(OpenCV REQUIRED)

# 包含PCL头文件
include_directories(${PCL_INCLUDE_DIRS})
include_directories(${OpenCV_INCLUDE_DIRS})

# 加入PCL定义（有些PCL头文件需要这个）
add_definitions(${PCL_DEFINITIONS})

# 添加你的头文件目录 (inc)
include_directories(${CMAKE_SOURCE_DIR}/inc)

# 搜集src目录下所有cpp文件
file(GLOB SRC_FILES ${CMAKE_SOURCE_DIR}/src/*.cpp)

# 你可以将main.cpp也放入src目录，或者保持不变，根据实际情况调整
# 这里假设main.cpp在顶层目录
add_executable(main main.cpp ${SRC_FILES})

# 链接PCL库
target_link_libraries(main
    ${PCL_LIBRARIES}
    ${OpenCV_LIBS}
)

# 可选：显示你的PCL信息，调试方便
message(STATUS "PCL INCLUDE DIRS: ${PCL_INCLUDE_DIRS}")
message(STATUS "PCL LIBRARIES: ${PCL_LIBRARIES}")
message(STATUS "OpenCV INCLUDE DIRS: ${OpenCV_INCLUDE_DIRS}") 
message(STATUS "OpenCV LIBS: ${OpenCV_LIBS}")                 
message(STATUS "SRC FILES: ${SRC_FILES}")